import 'package:bazi/model/jieqi_model.dart';
import 'package:bazi/model/paipan_model.dart';
import 'package:bazi/model/sizhu_model.dart';
import 'package:bazi/util/my_color.dart';
import 'package:bazi/util/paipan.dart';
import 'package:bazi/util/resurce.dart';
import 'package:bazi/util/solarToLunar.dart';
import 'package:bazi/widgets/title_widget.dart';
import 'package:flutter/material.dart';

import 'calendar_widget.dart';

class PaiPanPage extends StatefulWidget {
  const PaiPanPage({Key? key}) : super(key: key);

  @override
  _PaiPanPageState createState() => _PaiPanPageState();
}

class _PaiPanPageState extends State<PaiPanPage> with AutomaticKeepAliveClientMixin {
  ///世纪
  var _century = 0;

  ///年
  var _year = 0;

  ///月
  var _month = 0;

  ///日
  var _day = 0;

  String _date ='';
  String _lunraDate='';
  bool _isLunar = false;
  ///时辰
  int _hour = 0;
  var _hourValue = "子时 00:00-00:59";
  late JieqiModel _jieqiModel;
  var _paipanUtil = PaipanUtil.instance();

  ///四柱八字
  var _paipanModel = PaipanModel();
  var _sizhuModel = SizhuModel();
  var _tgwx = "木";
  ///十神
  Map<String, String> _shishen = {};

  var groupIndex = 0;

  ///性别
  int _sex = 0;

  ///大运
  List _daYun = [];
  List _daYunG = [];
  List _daYunWS = [];
  List _crossLuck = [];
  List _qiYunAge = [];

  ///神煞
  List<List<String>> _shensha = [];
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    var dateTime = DateTime.now();
    _date = "公历：${dateTime.year}年${dateTime.month}月${dateTime.day}日";
    List<String> lunarMonthList = List.from(SolarToLunar.chineseNumber);
    SolarToLunar lunar = SolarToLunar(DateTime(dateTime.year,dateTime.month,dateTime.day));
    _lunraDate = "农历：${lunar.year}年${lunarMonthList[lunar.month-1]}月${SolarToLunar.getChinaDayString(lunar.day)}";
    _century = int.parse(dateTime.year.toString().substring(0, 2));
    _year = int.parse(dateTime.year.toString().substring(2, 4));
    _month = dateTime.month;
    _day = dateTime.day;
  }

  void _paipan() {

    ///节气
    _jieqiModel = _paipanUtil.getJieqi(_century, _year);
    print(_hour);
    ///四柱

    _paipanModel = _paipanUtil.getPaipan(
        _century, _year, _month, _day, _hour, _jieqiModel, _sex);
    _sizhuModel = _paipanModel.sizhuModel;
    switch(_sizhuModel.dayG){
      case '甲':
      case '乙':
        _tgwx = "木";
        break;
      case '丙':
      case '丁':
        _tgwx = "火";
        break;
      case '戊':
      case '己':
        _tgwx = "土";
        break;
      case '庚':
      case '辛':
        _tgwx = "金";
        break;
      case '壬':
      case '癸':
        _tgwx = "水";
        break;
    }

    ///十神
    _shishen = _paipanUtil.shishen[_paipanModel.sizhuModel.dayG]!;
    _daYun.clear();
    _daYunWS.clear();
    _daYunG.clear();
    _qiYunAge.clear();
    _crossLuck.clear();
    _paipanModel.daYun.forEach((e) {
      _daYun.add(e.ganzhi);
      _daYunG.add(e.ganSS);
      _daYunWS.add(e.zhiWS);
      _qiYunAge.add(e.xuSui);
      _crossLuck.add(e.crossYear);
    });
    _daYun.insert(0, '大运');
    _daYunG.insert(0, '');
    _daYunWS.insert(0, '旺衰');
    _qiYunAge.insert(0, '虚岁');
    _crossLuck.insert(0, '年份');
    _shensha = _paipanUtil.getShensha(_sizhuModel);
    setState(() {});
  }
  ///时辰
  void _hourSelected(){
    showDialog(context: context, builder: (_){
      return Material(
        type: MaterialType.transparency,
        child: Center(
          child: Container(
            width: double.infinity,
            margin: EdgeInsets.symmetric(horizontal: 10),
            padding: EdgeInsets.symmetric(horizontal: 10),
            height: 580,
            decoration: BoxDecoration(color: Colors.white,borderRadius: BorderRadius.circular(10)),
            child: ListView(children: _paipanUtil.items.map((e) => Row(
              children: [

                Expanded(child: Text(e,style: TextStyle(fontSize: 16),)),
                Radio<int>(
                  value: _paipanUtil.items.indexOf(e),
                  groupValue: _hour,
                  onChanged: ( v) {
                    if(v==12){
                      _hour = 0;
                    }else{
                      _hour = v ?? 0;
                      //早子时属于第二天
                      if(v==0){
                        _day++;
                      }
                    }


                    //立春前一月二月属于去年13月14月
                    if (_month == 14) {
                      if (_day <= _jieqiModel.limit[0]) {
                        _month = 2;
                        _year++;
                      }
                    }
                    if (_month == 13) {
                      _month = 1;
                      _year++;
                    }
                    Navigator.pop(context);
                    _hourValue = _paipanUtil.items[v??0];
                    setState(() {

                    });
                  },
                  activeColor: MyColor.primaryColor,
                ),
              ],
            )).toList(),),
          ),
        ),
      );
    });
  }
  ///日期
  void _dateSelected(){
    showDialog(
        barrierDismissible: false,
        context: context,
        builder: (context) {
          return CalendarWidget(int.parse(_century.toString()+_year.toString()),_month,_day,(year,month,day,date,lunarDate,isLunar,hour){
            _century = int.parse(year.toString().substring(0, 2));
            _year = int.parse(year.toString().substring(2, 4));
            _month = month;
            _day = day;
            _date =date;
            _lunraDate = lunarDate;
            _isLunar = isLunar;
            setState(() {

            });
          });
        });
  }
  ///基础信息
  Widget _basicInfo(){
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Container(
          child: Text(
            '基本信息',
            style: TextStyle(color: Colors.white),
          ),
          color: MyColor.textOrange,
          padding: EdgeInsets.only(
              left: 5, right: 5, bottom: 4, top: 1),
        ),
        SizedBox(
          height: 10,
        ),
        Text.rich(TextSpan(children: [
          TextSpan(
              text: '性别：',
              style: TextStyle(fontWeight: FontWeight.bold)),
          TextSpan(text: _sex == 0 ? '男' : '女')
        ])),
        Text.rich(TextSpan(children: [
          TextSpan(
              text: '公历：',
              style: TextStyle(fontWeight: FontWeight.bold)),
          TextSpan(
              text:
              _date.substring(3))
        ])),
        Text.rich(TextSpan(children: [
          TextSpan(
              text: '农历：',
              style: TextStyle(fontWeight: FontWeight.bold)),
          TextSpan(
              text:_lunraDate.substring(3))
        ])),
        Text.rich(TextSpan(children: [
          TextSpan(
              text: '前节：',
              style: TextStyle(fontWeight: FontWeight.bold)),
          TextSpan(text: '${_paipanModel.qianJie}')
        ])),
        Text.rich(TextSpan(children: [
          TextSpan(
              text: '后节：',
              style: TextStyle(fontWeight: FontWeight.bold)),
          TextSpan(text: '${_paipanModel.houJie}')
        ])),
        Text.rich(TextSpan(children: [
          TextSpan(
              text: '起运周岁：',
              style: TextStyle(fontWeight: FontWeight.bold)),
          TextSpan(text: '${_paipanModel.qiYunAge}')
        ])),
        Text.rich(TextSpan(children: [
          TextSpan(
              text: '交运：',
              style: TextStyle(fontWeight: FontWeight.bold)),
          TextSpan(text: '${_paipanModel.qiYunDate}')
        ])),
        Text.rich(TextSpan(children: [
          TextSpan(
              text: '空亡：',
              style: TextStyle(fontWeight: FontWeight.bold)),
          TextSpan(text: '${_paipanModel.kongwang}')
        ])),

        ///表单
        Container(
          margin: EdgeInsets.symmetric(vertical: 10),
          decoration: BoxDecoration(
              border: Border.all(
                color: MyColor.textOrange,
                width: 2,
              )),
          child: Table(
            border: TableBorder(
                horizontalInside:
                BorderSide(color: MyColor.textOrange),
                verticalInside:
                BorderSide(color: MyColor.textOrange)),
            defaultVerticalAlignment:
            TableCellVerticalAlignment.middle,
            children: [
              TableRow(children: [
                SizedBox(
                  height: 40,
                ),
                Container(
                  alignment: Alignment.center,
                  child: Text(
                    '年柱',
                    style: TextStyle(fontWeight: FontWeight.bold),
                  ),
                ),
                Container(
                  alignment: Alignment.center,
                  child: Text('月柱',
                      style:
                      TextStyle(fontWeight: FontWeight.bold)),
                ),
                Container(
                  alignment: Alignment.center,
                  child: Text('日柱',
                      style:
                      TextStyle(fontWeight: FontWeight.bold)),
                ),
                Container(
                  alignment: Alignment.center,
                  child: Text('时柱',
                      style:
                      TextStyle(fontWeight: FontWeight.bold)),
                ),
              ]),
              TableRow(children: [
                Container(
                  child: Text('十神'),
                  height: 40,
                  alignment: Alignment.center,
                ),
                Container(child: Text(_shishen[_sizhuModel.yearG]!),alignment: Alignment.center,),
                Container(child: Text(_shishen[_sizhuModel.monthG]!),alignment: Alignment.center,),
                Container(child: Text('日主'),alignment: Alignment.center,),
                Container(child: Text(_shishen[_sizhuModel.hourG]!),alignment: Alignment.center,),
              ]),
              TableRow(children: [
                Container(
                  child: Text(_sex == 0 ? '乾造' : '坤造',
                      style: TextStyle(
                          color: MyColor.primaryColor,
                          fontWeight: FontWeight.bold)),
                  height: 40,
                  alignment: Alignment.center,
                ),
                Container(
                  alignment: Alignment.center,
                  child: Text(_sizhuModel.yearG + _sizhuModel.yearZ,
                      style:
                      TextStyle(color: MyColor.primaryColor)),
                ),
                Container(
                  alignment: Alignment.center,
                  child: Text(_sizhuModel.monthG + _sizhuModel.monthZ,
                      style:
                      TextStyle(color: MyColor.primaryColor)),
                ),
                Container(
                  alignment: Alignment.center,
                  child: Text(_sizhuModel.dayG + _sizhuModel.dayZ,
                      style:
                      TextStyle(color: MyColor.primaryColor)),
                ),
                Container(
                  alignment: Alignment.center,
                  child: Text(_sizhuModel.hourG + _sizhuModel.hourZ,
                      style:
                      TextStyle(color: MyColor.primaryColor)),
                ),
              ]),
              TableRow(children: [
                Container(
                  child: Text('地支藏干',
                      style: TextStyle(
                          fontWeight: FontWeight.bold)),
                  height: 80,
                  alignment: Alignment.center,
                ),
                Column(
                  children: _paipanUtil
                      .hiddenGan[_sizhuModel.yearZ]!
                      .map((e) => Text(e + " " + _shishen[e]!))
                      .toList(),
                ),
                Column(
                  children: _paipanUtil
                      .hiddenGan[_sizhuModel.monthZ]!
                      .map((e) => Text(e + " " + _shishen[e]!))
                      .toList(),
                ),
                Column(
                  children: _paipanUtil
                      .hiddenGan[_sizhuModel.dayZ]!
                      .map((e) => Text(e + " " + _shishen[e]!))
                      .toList(),
                ),
                Column(
                  children: _paipanUtil
                      .hiddenGan[_sizhuModel.hourZ]!
                      .map((e) => Text(e + " " + _shishen[e]!))
                      .toList(),
                ),
              ]),
              TableRow(children: [
                Container(
                  child: Text('旺衰',
                      style: TextStyle(
                          fontWeight: FontWeight.bold)),
                  height: 40,
                  alignment: Alignment.center,
                ),
                Container(
                  alignment: Alignment.center,
                  child: Text(_paipanUtil.riseDecline[
                  _sizhuModel.dayG]![_sizhuModel.yearZ]!),
                ),
                Container(
                  alignment: Alignment.center,
                  child: Text(_paipanUtil.riseDecline[
                  _sizhuModel.dayG]![_sizhuModel.monthZ]!),
                ),
                Container(
                  alignment: Alignment.center,
                  child: Text(_paipanUtil.riseDecline[
                  _sizhuModel.dayG]![_sizhuModel.dayZ]!),
                ),
                Container(
                  alignment: Alignment.center,
                  child: Text(_paipanUtil.riseDecline[
                  _sizhuModel.dayG]![_sizhuModel.hourZ]!),
                ),
              ]),
              TableRow(children: [
                Container(
                  child: Text('纳音',
                      style: TextStyle(
                          fontWeight: FontWeight.bold)),
                  height: 40,
                  alignment: Alignment.center,
                ),
                Container(
                  alignment: Alignment.center,
                  child: Text(_paipanUtil.nayin[
                  _sizhuModel.yearG + _sizhuModel.yearZ]!),
                ),
                Container(
                  alignment: Alignment.center,
                  child: Text(_paipanUtil.nayin[
                  _sizhuModel.monthG + _sizhuModel.monthZ]!),
                ),
                Container(
                  alignment: Alignment.center,
                  child: Text(_paipanUtil.nayin[
                  _sizhuModel.dayG + _sizhuModel.dayZ]!),
                ),
                Container(
                  alignment: Alignment.center,
                  child: Text(_paipanUtil.nayin[
                  _sizhuModel.hourG + _sizhuModel.hourZ]!),
                ),
              ]),
            ],
          ),
        ),

        ///大运
        Container(
          child: Text(
            '大运',
            style: TextStyle(color: Colors.white),
          ),
          color: MyColor.textOrange,
          padding:
          EdgeInsets.only(bottom: 4, left: 10, right: 10),
          margin: EdgeInsets.only(top: 20, bottom: 10),
        ),

        Table(
          children: [
            TableRow(
                children: _daYunG
                    .map((e) => Container(
                  child: Text(e),
                  margin:
                  EdgeInsets.symmetric(vertical: 5),
                ))
                    .toList()),
            TableRow(
                children: _daYun
                    .map((e) => Container(
                  child: Text(e),
                  margin:
                  EdgeInsets.symmetric(vertical: 5),
                ))
                    .toList()),
            TableRow(
                children: _daYunWS
                    .map((e) => Container(
                  child: Text(e),
                  margin:
                  EdgeInsets.symmetric(vertical: 5),
                ))
                    .toList()),
            TableRow(
                children: _qiYunAge
                    .map((e) => Container(
                  child: Text(e.toString()),
                  margin:
                  EdgeInsets.symmetric(vertical: 5),
                ))
                    .toList()),
            TableRow(
                children: _crossLuck
                    .map((e) => Container(
                  child: Text(e.toString()),
                  margin:
                  EdgeInsets.symmetric(vertical: 5),
                ))
                    .toList()),
          ],
        ),

        ///流年
        Container(
          child: Text(
            '流年',
            style: TextStyle(color: Colors.white),
          ),
          color: MyColor.textOrange,
          padding:
          EdgeInsets.only(bottom: 4, left: 10, right: 10),
          margin: EdgeInsets.only(top: 20, bottom: 10),
        ),
        Wrap(
          children: _paipanModel.liuNian
              .map((e) => Column(
            children: [Text(e.ganZ), Text(e.year)],
          ))
              .toList(),
          spacing: 5,
          runSpacing: 10,
        ),
        SizedBox(
          height: 20,
        ),
        Text("神煞",style: TextStyle(color: MyColor.lightRed,fontWeight: FontWeight.w700),),
        SizedBox(height: 10,),
        Row(
          children: [
            Text("年柱：",style: TextStyle(fontWeight: FontWeight.bold),),
            Row(
              children: _shensha[0].length == 0
                  ? [Text("无")]
                  : _shensha[0]
                  .map((e) => Container(
                  padding: EdgeInsets.only(right: 10),
                  child: Text(e)))
                  .toList(),
            )
          ],
        ),
        SizedBox(height: 6,),
        Row(
          children: [
            Text("月柱：",style: TextStyle(fontWeight: FontWeight.bold)),
            Row(
              children: _shensha[1].length == 0
                  ? [Text("无")]
                  : _shensha[1]
                  .map((e) => Container(
                  padding: EdgeInsets.only(right: 10),
                  child: Text(e)))
                  .toList(),
            )
          ],
        ),
        SizedBox(height: 6,),
        Row(
          children: [
            Text("日柱：",style: TextStyle(fontWeight: FontWeight.bold)),
            Row(
              children: _shensha[2].length == 0
                  ? [Text("无")]
                  : _shensha[2]
                  .map((e) => Container(
                  padding: EdgeInsets.only(right: 10),
                  child: Text(e)))
                  .toList(),
            )
          ],
        ),
        SizedBox(height: 6,),
        Row(
          children: [
            Text("时柱：",style: TextStyle(fontWeight: FontWeight.bold)),
            Row(
              children: _shensha[3].length == 0
                  ? [Text("无")]
                  : _shensha[3]
                  .map((e) => Container(
                  padding: EdgeInsets.only(right: 10),
                  child: Text(e)))
                  .toList(),
            )
          ],
        ),
      ],
    );
  }
  ///日柱论命
  Widget _dayForDestiny(){
    return Column(children: [
      TitleWidget("日柱论命"),
      SizedBox(height: 10,),
      Text("【日干心性】",style: TextStyle(fontWeight: FontWeight.bold)),
      SizedBox(height: 10,),
      Text("${Resource.dayGTrait[_sizhuModel.dayG]}"),
      SizedBox(height: 10,),
      Text("【日干支层次】",style: TextStyle(fontWeight: FontWeight.bold)),
      SizedBox(height: 10,),
      Text("[${_sizhuModel.dayG}${_sizhuModel.dayZ}][${Resource.gzLevel[_sizhuModel.dayG+_sizhuModel.dayZ]![0]}]${Resource.gzLevel[_sizhuModel.dayG+_sizhuModel.dayZ]![1]}"),
      SizedBox(height: 10,),
      Text("【日干支分析】",style: TextStyle(fontWeight: FontWeight.bold)),
      SizedBox(height: 10,),
      Text(Resource.gzLevel[_sizhuModel.dayG+_sizhuModel.dayZ]![2]),
    ],crossAxisAlignment: CrossAxisAlignment.start,);
  }
  ///五行论命
  Widget _wxForDestiny(){
    return Column(children: [
      TitleWidget("五行论命"),
      SizedBox(height: 10,),
      Text("【五行生克 制化宜忌】",style: TextStyle(fontWeight: FontWeight.bold)),
      SizedBox(height: 10,),
      Text(Resource.WXTrait[_tgwx]![0]),
      SizedBox(height: 10,),
      Text("【五行之性】",style: TextStyle(fontWeight: FontWeight.bold)),
      SizedBox(height: 10,),
      Text(Resource.WXTrait[_tgwx]![1]),
      SizedBox(height: 10,),
      Text("【四柱五行生克中对应需补的脏腑合部位】",style: TextStyle(fontWeight: FontWeight.bold)),
      SizedBox(height: 10,),
      Text(Resource.WXTrait[_tgwx]![2]),
      SizedBox(height: 10,),
      Text("【宜从事行业与方位】",style: TextStyle(fontWeight: FontWeight.bold)),
      SizedBox(height: 10,),
      Text(Resource.WXTrait[_tgwx]![3]),
    ],crossAxisAlignment: CrossAxisAlignment.start,);
  }
  ///三命通会
  Widget _SMTHForDestiny(){
    Map<String ,String> map = Resource.SMTHTrait[_sizhuModel.dayG]![_sizhuModel.hourG+_sizhuModel.hourZ]![1] as Map<String,String>;
    return Column(children: [
      TitleWidget("三命通会"),
      SizedBox(height: 10,),
      Text(Resource.SMTHTrait[_sizhuModel.dayG]![_sizhuModel.hourG+_sizhuModel.hourZ]![0].toString()),
      SizedBox(height: 10,),
      Text(map[_sizhuModel.dayG+_sizhuModel.dayZ]!),
    ],crossAxisAlignment: CrossAxisAlignment.start,);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      body: ListView(
        padding: EdgeInsets.zero,
        children: [
          TitleWidget("生辰八字算命"),

          Container(
            margin: EdgeInsets.symmetric(vertical: 10,horizontal: 10),
            decoration: BoxDecoration(
                color: MyColor.lightBg,
                border: Border.all(
                  color: MyColor.textOrange,),
                borderRadius: BorderRadius.circular(10)
            ),
            child: Column(
              children: [
                ///日期选择
                Container(
                  height: 40,
                  margin: EdgeInsets.symmetric(horizontal: 14),
                  child: Row(
                    children: [
                      Text("出生日期:",style: TextStyle(fontWeight: FontWeight.w700,fontSize: 16),),
                      SizedBox(width: 10,),
                      GestureDetector(
                          child: Text(_isLunar?_lunraDate:_date,style: TextStyle(fontSize: 16),),
                          onTap:_dateSelected

                      )

                    ],
                  ),
                ),
                Divider(color:MyColor.textOrange),
                ///时辰选择
                GestureDetector(
                  onTap: _hourSelected,
                  behavior: HitTestBehavior.opaque,
                  child: Container(
                    height: 40,
                    margin: EdgeInsets.symmetric(horizontal: 14),
                    child: Row(
                      children: [
                        Text("出生时辰:",style: TextStyle(fontWeight: FontWeight.w700,fontSize: 16),),
                        SizedBox(width: 10,),
                        Text(_hourValue,style: TextStyle(fontSize: 16)),


                      ],
                    ),
                  ),
                ),
                Divider(color:MyColor.textOrange),
                ///性别
                Container(
                  height: 40,
                  margin: EdgeInsets.symmetric(horizontal: 14),
                  child: Row(
                    children: [
                      Text("性       别:",style: TextStyle(fontWeight: FontWeight.w700,fontSize: 16),),
                      SizedBox(width: 10,),
                      Radio(
                        value: 0,
                        groupValue: groupIndex,
                        onChanged: (v) {
                          groupIndex = 0;
                          _sex = 0;
                          setState(() {});
                        },
                        activeColor: MyColor.primaryColor,
                      ),
                      Text('男'),
                      Radio(
                        value: 1,
                        groupValue: groupIndex,
                        onChanged: (v) {
                          groupIndex = 1;
                          _sex = 1;
                          setState(() {});
                        },
                        activeColor: MyColor.primaryColor,
                      ),
                      Text('女'),

                    ],
                  ),
                ),
              ],
            ),
          ),

          Row(children: [
            Expanded(
              child: GestureDetector(
                onTap: _paipan,
                child: Container(
                  margin: EdgeInsets.only(left: 10,right:10),
                  child: Stack(children:[
                    Image.asset("assets/button.png",),
                    Text("生辰八字算命",style: TextStyle(color: Colors.white,fontSize: 16,fontWeight: FontWeight.w800),)
                  ],alignment: Alignment.center),
                ),
              ),
            ),
            Expanded(
              child: GestureDetector(
                onTap: (){

                },
                child: Container(
                  margin: EdgeInsets.only(left:10,right: 10),
                  child: Stack(children:[
                    Image.asset("assets/button.png",),
                    Text("八字精批",style: TextStyle(color: Colors.white,fontSize: 16,fontWeight: FontWeight.w800),)
                  ],alignment: Alignment.center,),
                ),
              ),
            ),
          ],),
          SizedBox(height: 10,),
          Visibility(child: TitleWidget("孟氏生辰八字算命"),visible: _sizhuModel.dayG==''?false:true,),
          ///结果
          _sizhuModel.dayG == ''
              ? Container()
              : Container(
            margin: EdgeInsets.only(left: 10,right: 10,bottom: 30),
            child: DefaultTextStyle.merge(
              // textAlign: TextAlign.center,
              style: TextStyle(color: MyColor.textOrange),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                mainAxisAlignment: MainAxisAlignment.start,
                children: [
                  ///基本信息
                  _basicInfo(),
                  SizedBox(height: 10,),
                  ///日柱论命
                  _dayForDestiny(),
                  ///五行论命
                  _wxForDestiny(),
                  ///三命通会
                  _SMTHForDestiny(),
                  ///命造简批
                  TitleWidget("命造简批"),
                  SizedBox(height: 10,),
                  Text(Resource.SimpleTraitDayG[_sizhuModel.dayG]!),
                ],
              ),
            ),
          ),
        ],
      ),
      // This trailing comma makes auto-formatting nicer for build methods.
    );
  }

  @override
  // TODO: implement wantKeepAlive
  bool get wantKeepAlive =>  true;
}

